--money.lua
--Adds methods to Player object for manipulating money

local playermt = FindMetaTable("Player")

function playermt:GetMoney()
	return self:GetNetworkedInt("money")
end

function playermt:SetMoney(value)
	self:SetNetworkedInt("money", value)
	self:SaveMoney()
end

function playermt:SaveMoney()
	self:SetPData("money", self:GetMoney())
end

function playermt:LoadMoney()	
	if not self:GetPData("money") then
		self:SetPData("money", STARTING_MONEY)
	end
	self:SetMoney(self:GetPData("money"))
end
